package com.cuit.ocp.dao;

import com.cuit.ocp.bean.ReturnOrder;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface ReturnOrderDao {
    @Select("select * from return_goods order by re_id asc")
    List<ReturnOrder> selectAllReturnOrderByPage();

    @Insert("insert into return_goods(buyerName,buyerPhone,returnDate,returnWay,returnNote,returnCount,returnPrice,traderId)"+
            "values (#{buyerName},#{buyerPhone},#{returnDate},#{returnWay}, #{returnNote}, #{returnCount},#{returnPrice}, #{traderId})")
    int addReturnOrder(ReturnOrder returnOrder);

    @Delete("delete from return_goods where re_id=#{re_id}")
    int deleteReturnOrderById(int re_id);

    int updateReturnOrderById(ReturnOrder returnOrder);

    @Select("select * from return_goods where re_id=#{re_id}")
    ReturnOrder selectReturnOrderById(int re_id);

    List<ReturnOrder> selectReturnOrderByName(String order_name);
}
